package com.wxlalt.rediscache.controller;

import com.wxlalt.rediscache.entity.Result;
import com.wxlalt.rediscache.entity.Shop;
import org.springframework.web.bind.annotation.*;

import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference;

@RequestMapping("/shop")
public interface IShopController {
    /**
     * 根据id查询商铺信息
     * @param id 商铺id
     * @return 商铺详情数据
     */
    @GetMapping("/{id}")
    Result queryShopById(@PathVariable("id") Long id, @RequestHeader(value = "version",required = false)String version);

    /**
     * 新增商铺信息
     * @param shop 商铺数据
     * @return 商铺id
     */
    @PostMapping
    Result saveShop(@RequestBody Shop shop);

    /**
     * 更新商铺信息
     * @param shop 商铺数据
     * @return 无
     */
    @PutMapping
    Result updateShop(@RequestBody Shop shop,@RequestHeader(value = "version",required = false)String version);
}
